import request from '../../../plugins/axios'


/**
 * 获取某一个id的权限
 * @param id 权限id
 */
export function loadPermission(id) {
    return request({
        url: '/permission/{id}'.replace("{id}", id),
        method: 'get',
    })
}
/**
 * 新增权限
 * @param data 添加权限
 */
export function createPermission(data) {
    return request({
        url: '/permission',
        method: 'post',
        data
    })
}

/**
 * 更新权限
 * @param data 添加权限
 * @param id 需要更新的权限id
 */
export function updatePermission(data, id) {
    return request({
        url: '/permission/{id}'.replace("{id}", id),
        method: 'put',
        data
    })
}
/**
 * 删除权限
 * @param id 权限id
 */
export function deletePermission(id) {
    return request({
        url: '/permission/{id}'.replace("{id}", id),
        method: 'delete',

    })
}
